<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>详情</title>
    <link rel="stylesheet" href="${ctxPath}/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="${ctxPath}/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${ctxPath}/css/common.css">
    <link rel="stylesheet" href="${ctxPath}/css/topic.css">
    <link rel="stylesheet" href="${ctxPath}/css/jieda.css">
    <link rel="icon" href="/img/字体6.png">
</head>
<body>
<jsp:include page="/WEB-INF/pages/commons/header.jsp"></jsp:include>

<%--面包屑导航条--%>
<nav class="breadcrumb col-2">
    <a class="breadcrumb-item" href="${ctxPath}/index.jsp">首页</a>
    <span class="breadcrumb-item ">话题列表</span>
</nav>

<%--当前页面主要内容--%>
<main class="topic-detail-container ">
    <div class="explain o">
        <div class="begin"></div>
        <div class="a">
            <div class="aa">
                <b>${topic.author.nickname}</b>
            </div>
            <div class="ab">
                <span ><b>${topic.author.nickname} </b></span>
                <span >发布时间 &nbsp;&nbsp;${topic.publishTime}</span>
            </div>
            <div class="ac">
                <a href="${ctxPath}/explain/${explain.id}/removeexplain" >X</a>
            </div>
        </div>
        <div class="topic-title biaoti">${topic.title}</div>
        <div class="b ob">
            <b>${topic.content}</b>
        </div>
        <div class="c">
            <c:if test="${not empty sessionScope.customer}">
                <div class="row open-explain-page">
                    <a href="${ctxPath}/topic/${topic.id}/explain" class=" btn btn-primary btn-sm">我来解答</a>
                </div>
            </c:if>
        </div>
    </div>
    <div class="topic-explains">
        <c:if test="${ empty topic.explains }">
            暂时还没有回答，开始写第一个回答
        </c:if>
        <c:if test="${ not empty topic.explains }">
            <c:forEach items="${topic.explains}" var="e">
                <div class="explain o">
                    <div class="a">
                        <div class="aa">
                            <b>${e.author.nickname}</b>
                        </div>
                        <div class="ab">
                            <span ><b>${e.author.nickname}</b>&nbsp;&nbsp;&nbsp;${x.count}楼</span>
                            <span >评论时间 &nbsp;&nbsp;${e.publishTime}</span>
                        </div>
                        <div class="ac">
                            <a href="${ctxPath}/explain/${explain.id}/removeexplain" ><b>X</b></a>
                        </div>
                    </div>
                    <div class="b">
                            ${e.content}
                    </div>
                    <div class="c">
                        <c:forEach items="${e.thumbsList}" var="t">
                            <c:if test="${t.customer_id==customer.id}">
                                <c:set var="operation" value="${t.operation}" scope="page"></c:set>
                            </c:if>
                        </c:forEach>
                        <div>
                            <a href="/explain/praise?id=${e.id}" class="praise">
                                <i class="${operation==1?"fa fa-thumbs-up":"fa fa-thumbs-o-up"}"></i>赞(${e.praise})
                            </a>
                            <a href="/explain/despise?id=${e.id}" class="despise">
                                <i class="${operation==2?"fa fa-thumbs-down":"fa fa-thumbs-o-down"}"></i>踩(${e.despise})
                            </a>
                        </div>
                    </div>
                </div>
            </c:forEach>
        </c:if>
    </div>

</main>


